package com.tree.thrive.adapter.openapi;

import com.tree.thrive.business.task.TaskService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * top-tree
 *
 * @Auther: cheng.tang
 * @Date: 2023/1/9 6:51 PM
 * @Description:
 */
@RestController
@Slf4j
public class WorkManageController {

    @Autowired
    private TaskService taskService;

    @GetMapping("/task/start")
    public String start() {
        taskService.startTask();
        taskService.doTask();
        return "start ok";
    }

    @GetMapping("/task/stop")
    public String stop() {
        taskService.stopTask();
        return "stop ok";
    }


}
